package com.techysky.util;

import java.io.File;

import javax.swing.filechooser.FileSystemView;

public class UDiskUtil {
	
	public static  String findURootPath(){
	    FileSystemView sys = FileSystemView.getFileSystemView();
	    //循环盘符
	    File[] files = File.listRoots();
	    File file = null;
	    String path = null;
	    for(int i = 0; i < files.length; i++) { 
	      if(sys.getSystemTypeDescription(files[i]).contains("U")){
	        file = files[i];
	        break;
	      }
	    }
	    if(file!=null){
	      path = file.getPath();
	    }
	    return path;
	  }
}
